Skip to content

feat: add buildPaymentMemo and parsePaymentMemo helpers - #707

Open
Olisachukwuma1 wants to merge 1 commit into
Stellar-split:mainfrom
Olisachukwuma1:feat/memo-builder
Open

feat: add buildPaymentMemo and parsePaymentMemo helpers#707
Olisachukwuma1 wants to merge 1 commit into
Stellar-split:mainfrom
Olisachukwuma1:feat/memo-builder

Conversation

@Olisachukwuma1

Copy link
Copy Markdown

Summary

Adds canonical memo helpers for Stellar invoice payment transactions, replacing ad-hoc memo string construction across callers.

  • \�uildPaymentMemo(invoiceId, opts?)\ — builds \split:{id}\ or \split:{id}:t{tranche}\ memos, truncated to 28 bytes at a valid UTF-8 character boundary
  • \parsePaymentMemo(memo)\ — parses both formats, returns
    ull\ for non-split memos
  • Both exported from \src/memoBuilder.ts\ and re-exported from \src/index.ts\

Tests

14 unit tests in \ est/memoBuilder.test.ts\ covering base format, tranche format, ASCII and multi-byte truncation, round-trips, null returns, and truncation edge cases.

closes #610

- buildPaymentMemo(invoiceId, opts?) builds split:{id} or split:{id}:t{tranche}
  memos, truncated to 28 bytes at a valid UTF-8 character boundary
- parsePaymentMemo(memo) parses both formats; returns null for non-split memos
- Both exported from src/memoBuilder.ts and re-exported from src/index.ts
- 14 unit tests covering base format, tranche, truncation (ASCII + multi-byte),
  round-trips, null returns, and truncation edge cases
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add buildPaymentMemo and parsePaymentMemo helpers to memoBuilder

1 participant